package mobile.game.common.config;

import java.io.IOException;

import com.alibaba.fastjson.JSONObject;

import mobile.game.common.config.run.JRunRoot;
import mobile.game.core.support.Utils;
import mobile.game.core.support.log.LogCore;

public class JRunConfig {
	private static JRunRoot root;

	public static boolean load(String jsonFile) {
		try {
			String jsonString = Utils.readFileToString(jsonFile, "UTF-8");
			root = JSONObject.parseObject(jsonString, JRunRoot.class);

			return true;
		} catch (IOException e) {
			LogCore.config.error("", e);
		}
		
		return false;
	}

	public static JRunRoot getRoot() {
		return root;
	}

	public static void main(String[] args) {
		load("Run.json");
	}
}
